numa: Correct handling node with CPU populated but no memory populated
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 5 Jan 2010 08:38:23 +0000 (08:38 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 5 Jan 2010 08:38:23 +0000 (08:38 +0000)
commit3f85a1728bf564b960005db42e43f7bb4fa7908a
tree6b87daac3078dda0d9e7a561af3e2c6352195423
parent9b0440ff26fa7c0b88f97c1323c718ca13baf4a0
numa: Correct handling node with CPU populated but no memory populated

In changeset 20599, the node that has no memory populated is marked
parsed, but not online. However, if there are CPU populated in this
node, the corresponding CPU mapping (i.e. the cpu_to_node) is still
setup to the offline node, this will cause trouble for memory
allocation.

This patch changes the init_cpu_to_node() and srant_detect_node(), to
considering the node is offlined situation.

Now the apicid_to_node is only used to keep the mapping between
cpu/node provided by BIOS, and should not be used for memory
allocation anymore.

One thing left is to update the cpu_to_node mapping after memory
populated by memory hot-add.

Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
This is a reintroduction of 20726:ddb8c5e798f9, which I incorrectly
reverted in 20745:d3215a968db9

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen/arch/x86/numa.c
xen/arch/x86/setup.c
xen/arch/x86/smpboot.c
xen/arch/x86/x86_64/mm.c